package org.qiyu.live.id.generate.privoder.service.bo;

import java.util.concurrent.atomic.AtomicLong;

public class LocalSeqIdBO {

    /**
     *在内存中记录的当前有序id的值
     */


    // currentStart=10000     nextThreshold=10050    step=50  currentNum=10000    10001   10002 10003  10004         75%
    // currentStart=10050     nextThreshold=10100    step=50  currentNum=10050    10051   10052

    private AtomicLong currentNum;
    private int id;
    private Long currentStart;
    private Long nextThreshold;

    public AtomicLong getCurrentNum() {
        return currentNum;
    }

    public void setCurrentNum(AtomicLong currentNum) {
        this.currentNum = currentNum;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Long getCurrentStart() {
        return currentStart;
    }

    public void setCurrentStart(Long currentStart) {
        this.currentStart = currentStart;
    }

    public Long getNextThreshold() {
        return nextThreshold;
    }

    public void setNextThreshold(Long nextThreshold) {
        this.nextThreshold = nextThreshold;
    }

    @Override
    public String toString() {
        return "LocalSeqIdBO{" +
                "currentNum=" + currentNum +
                ", id=" + id +
                ", currentStart=" + currentStart +
                ", nextThreshold=" + nextThreshold +
                '}';
    }
}
